<?php
require("sql_gamePlay.php");    // 玩家类
function strToHex($str)
{
    $str = iconv("UTF-8", "gbk//TRANSLIT", $str);
    $hex = "";
    for ($i = 0; $i < strlen($str); $i++)
        $hex .= dechex(ord($str[$i]));
    $hex = strtoupper($hex);
    return $hex;
}
function hexToStr($hex)
{
    $hex = iconv("UTF-8", "gbk//TRANSLIT", $hex);
    $str = "";
    for ($i = 0; $i < strlen($hex) - 1; $i += 2)
        $str .= chr(hexdec($hex[$i] . $hex[$i + 1]));
    return  iconv('GB2312', 'UTF-8', $str); // 将内容转为GB返回
}

if (!file_exists($cfg_arr['storage']) || $cfg_arr['storage'] == '') {
    exit('storage文件不存在');
}

$tq_db = new PDO('sqlite:' . $cfg_arr['storage']);


/* 申明玩家类 */
$tq_user = new Tq_user;
/* 初始化 */
$tq_user->init($tq_db);
